import javax.xml.soap.SOAPElementFactory;
import java.util.*;

public class Main1 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
         double sum=1;
        for(int i=1;i<=n;i++){
            sum*=i;
        }
        long a=1;
        while (a<=sum+1){
            int det=1;
            for(int i=1;i<=n;i++){
                if(i%a==0){
                    det=0;
                    break;
                }
            }
            if(det==0) {
                a++;
                continue;
            }
            else {
                System.out.println(a);
                break;
            }
        }
    }
    public static void main5(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int k=scanner.nextInt();
        int[][] ints=new int[2][n];
        for(int i=0;i<n;i++){
            ints[0][i]=scanner.nextInt();
        }
        for(int i=0;i<n;i++){
            ints[1][i]=scanner.nextInt();
        }
        int i=0;
        int sum=0;
        int det=0;
        int left = 0;
        int right = 0;
        while (left<n-1){
            right=left+1;
            int sum1=0;
            det=0;
            while (right!=n-1){
                if(ints[0][left]==ints[0][right]){
                    for(int j=left;j<=right;j++){
                        sum1+=ints[1][j];
                    }
                    left=right+1;
                    sum+=sum1;
                    det=1;
                    if(right==n-1) {
                        System.out.println(sum);
                        return;
                    }
                }
                if(det==1) break;
                else right++;
            }
            if(det==1) continue;
            else left++;
        }
        System.out.println(sum);

    }

    public static void main3(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String str=scanner.nextLine();
        int last=str.lastIndexOf(".");
        if(last==str.length()-1) {
            System.out.println("");
            return;
        }
        for (int i=last+1;i<str.length();i++){
            System.out.print(str.charAt(i));
        }

    }
    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int det1=scanner.nextInt();
        int det2=scanner.nextInt();
        if(det1<=10&&det2>=120){
            System.out.println("likewang");
        } else if (det1<=10&&det2<=40) {
            System.out.println("tangzhongtang");
        }
        else {
            System.out.println("common");
        }
    }
    public static void main6(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        scanner.nextLine();
        HashSet<String> hash=new HashSet<>();
        char[] chars=new char[n];
        for(int i=0;i<n;i++){
            String str=scanner.nextLine();
            chars[i]=str.charAt(0);
            hash.add(str);
        }
        char c='A';
        int sum=0;
        for(int i=0;i<n;i++){
            String str=chars[i]+" "+"Accepted";
            if(hash.contains(str)) {
                sum++;
                hash.remove(str);
            }
        }
        System.out.println(sum);
    }
}
